// @ts-ignore
/* eslint-disable */
import { OpenApi as request } from "@/utils/request";

/** 菜单新增 POST /supplyChain/menu/add */
export async function add4(
  body: API.MenuCreateDto,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseBoolean>(`/barter-user/supplyChain/menu/add`, {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}

/** 菜单删除 POST /supplyChain/menu/del */
export async function del2(body: API.IdDto, options?: { [key: string]: any }) {
  return request<API.BaseResponseBoolean>(`/barter-user/supplyChain/menu/del`, {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}

/** 菜单详情 GET /supplyChain/menu/detail */
export async function detail4(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.detail4Params,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseMenuVo>(
    `/barter-user/supplyChain/menu/detail`,
    {
      method: "GET",
      params: {
        ...params,
      },
      ...(options || {}),
    }
  );
}

/** 菜单编辑 POST /supplyChain/menu/edit */
export async function edit8(
  body: API.MenuUpdateDto,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseBoolean>(
    `/barter-user/supplyChain/menu/edit`,
    {
      method: "POST",
      headers: {
        "Content-Type": "application/json",
      },
      data: body,
      ...(options || {}),
    }
  );
}

/** 菜单列表 GET /supplyChain/menu/list */
export async function listTree(options?: { [key: string]: any }) {
  return request<API.BaseResponseListMenuVo>(
    `/barter-user/supplyChain/menu/list`,
    {
      method: "GET",
      ...(options || {}),
    }
  );
}
